home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Columbia Kermit
/
kermit.zip
/
newsgroups
/
misc.20010306-20010921
/
000042_news@columbia.edu _Wed Mar 28 17:52:01 2001.msg
< prev
next >
Wrap
Internet Message Format
|
2020-01-01
|
3KB
Return-Path: <news@columbia.edu>
Received: from newsmaster.cc.columbia.edu (newsmaster.cc.columbia.edu [128.59.59.30])
by monire.cc.columbia.edu (8.9.3/8.9.3) with ESMTP id RAA01951
for <kermit.misc@cpunix.cc.columbia.edu>; Wed, 28 Mar 2001 17:52:00 -0500 (EST)
Received: (from news@localhost)
by newsmaster.cc.columbia.edu (8.9.3/8.9.3) id RAA19820
for kermit.misc@watsun.cc.columbia.edu; Wed, 28 Mar 2001 17:25:08 -0500 (EST)
X-Authentication-Warning: newsmaster.cc.columbia.edu: news set sender to <news> using -f
From: fdc@columbia.edu (Frank da Cruz)
Subject: Re: need passive mode ftp command line client
Date: 28 Mar 2001 22:25:07 GMT
Organization: Columbia University
Message-ID: <99toc3$jba$1@newsmaster.cc.columbia.edu>
To: kermit.misc@columbia.edu
In article <9905ku$b4u$1@newsmaster.cc.columbia.edu>,
Frank da Cruz <fdc@watsun.cc.columbia.edu> wrote:
: In article <slrn9b5n4p.mt.grante@tuxtop.visi.com>,
: Grant Edwards <grante@visi.com> wrote:
: : On Fri, 16 Mar 2001 16:30:58 -0800, Anthony Ewell <aewell@gbis.com> wrote:
: : >I need to write a script that will do a directory
: : >of an ftp site. Then, depending on what I find in the
: : >directory, do a download in passive mode. (Passive
: : >mode is required to get by my firewall.)
:
A while back I answered this, recommending the new Kermit FTP
client, but it involved capturing the server's directory listing
and parsing it, which is crude, and then I said:
: C-Kermit 7.1 is currently in prerelease testing, so this is a good time
: to try it and send in any comments or suggestions about the scriptable
: FTP client. In fact, your problem suggests one improvement already, which
: is to make the NLST result available to the program directly, so you don't
: have to parse arbitrary directory-listing formats.
:
Silly me, I had already put this feature in without noticing that I did it.
The command is:
FTP MGET /NAMELIST:filename remote-filespec [ remote-filespec ... ]
This puts the list of names, one name per line, into the given filename.
For example:
ftp cd somedirectory
ftp mget /namelist:list-o-files *
If this succeeds, then you can use:
fopen /read \%c list-o-files
if fail ...
while not \f_eof(\%c) {
fread \%c filename
if fail ...
echo The next file is "\m(filename)"
}
echo Done.
Replace the ECHO statement with whatever you want to do with each file.
For more information on the new ftp client, visit:
http://www.columbia.edu/kermit/ftpclient.html
- Frank